{{ define "main" }}
{{ if isset .Data "Term" }}
<h1>Entries tagged - "{{ .Data.Term }}"</h1>
{{ else }}
<h1 class="page-title">{{ .Title }}</h1>
{{ end }}
{{ if isset .Params "tldr" }}
<div class="tldr">
	<strong>tl;dr:</strong>
	{{ .Params.tldr }}
</div>{{ end }}
<ul class="posts">
	{{- range .Data.Pages -}}
		{{- if (not (in (.Site.Params.excludedTypes | default (slice "page")) .Type)) -}}
		<li class="post">
			{{ if in .Params.category "Bahasa Melayu"}}	[MS] {{ else }} [EN] {{ end }}
			{{ if .Params.externalLink}}
				<a href="{{ .Params.externalLink}}" target="_blank">{{.Title | truncate 55 "..." }}</a> <span class="meta" style="float: right;">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
			{{else}}
				<a href="{{ .RelPermalink }}">{{.Title | truncate 45 "..." }}</a> <span class="meta" style="float: right;">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
			{{end}}
		</li>
		{{- end -}}
	{{- end -}}
</ul>
{{ end }}
